package com.example.springboot.dao;
import com.example.springboot.config.DaoProvider;
import com.example.springboot.model.admin_menu;
import com.example.springboot.model.admin_role;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface admin_roleMapper {
    /*查询全部*/
    @Select("select * from admin_role")
    List<admin_role> findAll();
    //根据id删除
    @Delete(" delete from admin_role where id= #{id} ")
    public void delete(int id);
    //根据id查询某一项
    @Select("select * from admin_role where id= #{id} ")
    public admin_role get(int id);


    /*以下不同*/
    //添加
    @Insert({"insert into admin_role (name,addtime)values (#{name},#{addtime})"})
    public int save(admin_role admin_role);
    //更新
    @Update("update admin_role set name=#{name} where id=#{id} ")
    public int update(admin_role admin_role);
    //条件筛选
    @SelectProvider(type = DaoProvider.class, method = "admin_roleWhere")
    List<admin_role> FindAllWhere(Map<String, Object> map);
}
